package com.ruoyi.houseClosing.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.houseClosing.domain.TMBank;
import com.ruoyi.houseClosing.mapper.TMBankMapper;
import com.ruoyi.houseClosing.service.ITMBankService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 银行代码Service业务层处理
 *
 * @author ruoyi
 * @date 2021-06-22
 */
@Service
public class TMBankServiceImpl implements ITMBankService
{
    @Autowired
    private TMBankMapper tMBankMapper;

    /**
     * 查询银行代码
     *
     * @param id 银行代码ID
     * @return 银行代码
     */
    @Override
    public TMBank selectTMBankById(Long id)
    {
        return tMBankMapper.selectTMBankById(id);
    }

    /**
     * 查询银行代码列表
     *
     * @param tMBank 银行代码
     * @return 银行代码
     */
    @Override
    public List<TMBank> selectTMBankList(TMBank tMBank)
    {
        return tMBankMapper.selectTMBankList(tMBank);
    }

    /**
     * 新增银行代码
     *
     * @param tMBank 银行代码
     * @return 结果
     */
    @Override
    public int insertTMBank(TMBank tMBank)
    {
        tMBank.setCreateTime(DateUtils.getNowDate());
        return tMBankMapper.insertTMBank(tMBank);
    }

    /**
     * 修改银行代码
     *
     * @param tMBank 银行代码
     * @return 结果
     */
    @Override
    public int updateTMBank(TMBank tMBank)
    {
        tMBank.setUpdateTime(DateUtils.getNowDate());
        return tMBankMapper.updateTMBank(tMBank);
    }

    /**
     * 批量删除银行代码
     *
     * @param ids 需要删除的银行代码ID
     * @return 结果
     */
    @Override
    public int deleteTMBankByIds(Long[] ids)
    {
        return tMBankMapper.deleteTMBankByIds(ids);
    }

    /**
     * 删除银行代码信息
     *
     * @param id 银行代码ID
     * @return 结果
     */
    @Override
    public int deleteTMBankById(Long id)
    {
        return tMBankMapper.deleteTMBankById(id);
    }

    @Override
    public List<TMBank> queryNames() {
        return tMBankMapper.queryNames();
    }
}
